Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix firewall rule to support empty descritpion on update #10950

Merged
merged 3 commits into from
Jun 18, 2024

Conversation

r-teller
Copy link
Contributor

@r-teller r-teller commented Jun 11, 2024

Fixed google_compute_firewall to support updating description field to empty or null value, currently when the value changes to null/empty updates are not pushed

Release Note Template for Downstream PRs (will be copied)

compute: fixed `description` field in `google_compute_firewall` to support empty/null values on update

@github-actions github-actions bot requested a review from slevenick June 11, 2024 23:46
Copy link

Hello! I am a robot. Tests will require approval from a repository maintainer to run.

@slevenick, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look.

You can help make sure that review is quick by doing a self-review and by running impacted tests locally.

@modular-magician modular-magician added the awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests label Jun 11, 2024
Copy link
Contributor

@slevenick slevenick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a test that would specifically update this field to empty and check that it works?

@modular-magician modular-magician added service/network-security-distributed-firewall and removed awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests labels Jun 12, 2024
@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 1 file changed, 2 insertions(+), 2 deletions(-))
google-beta provider: Diff ( 1 file changed, 2 insertions(+), 2 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 1 insertion(+), 1 deletion(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 956
Passed tests: 881
Skipped tests: 74
Affected tests: 1

Click here to see the affected service packages
  • compute

Action taken

Found 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccComputeInstanceNetworkIntefaceWithSecurityPolicy

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$
TestAccComputeInstanceNetworkIntefaceWithSecurityPolicy[Error message] [Debug log]

$\textcolor{red}{\textsf{Please fix these to complete your PR.}}$
View the build log or the debug log for each test

@github-actions github-actions bot requested a review from slevenick June 12, 2024 19:03
@modular-magician modular-magician added the awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests label Jun 12, 2024
@r-teller
Copy link
Contributor Author

I have modify TestAccComputeFirewall_update to verify that description can be set to null/empty

@modular-magician modular-magician removed the awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests label Jun 12, 2024
@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 2 files changed, 35 insertions(+), 2 deletions(-))
google-beta provider: Diff ( 2 files changed, 35 insertions(+), 2 deletions(-))
terraform-google-conversion: Diff ( 1 file changed, 1 insertion(+), 1 deletion(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 960
Passed tests: 884
Skipped tests: 74
Affected tests: 2

Click here to see the affected service packages
  • compute

Action taken

Found 2 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccComputeFirewall_update|TestAccComputeInstanceNetworkIntefaceWithSecurityPolicy

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{green}{\textsf{Tests passed during RECORDING mode:}}$
TestAccComputeFirewall_update[Debug log]

$\textcolor{green}{\textsf{No issues found for passed tests after REPLAYING rerun.}}$


$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$
TestAccComputeInstanceNetworkIntefaceWithSecurityPolicy[Error message] [Debug log]

$\textcolor{red}{\textsf{Please fix these to complete your PR.}}$
View the build log or the debug log for each test

@slevenick
Copy link
Contributor

Can you explain why setting the description to empty is desirable? I get that it's technically correct, but it may introduce unexpected behavior as most of our resources with descriptions don't behave like this

Are you running into a specific issue around the description field?

@r-teller
Copy link
Contributor Author

I noticed that for most resources within GCP, the description is an immutable field, but for firewall rules, it is not. Through the console or gcloud command, you can set this to empty. However, when using Terraform, it provides a different experience.

In my organization, I observed that you could create a firewall rule without a description, but once a rule has a description, you couldn't set it back to empty. The goal for this merge was to align Terraform functionality with the expected experience provided through other interactions

Copy link

@slevenick This PR has been waiting for review for 3 weekdays. Please take a look! Use the label disable-review-reminders to disable these notifications.

Copy link
Contributor

@slevenick slevenick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is causing a failure in TGC (which you don't need to know about) but I think the way to fix it is to add a description to this file: https://github.com/GoogleCloudPlatform/magic-modules/blob/main/mmv1/third_party/tgc/tests/data/firewall.json

Can you try that and we'll see if the tests pass? I'm not entirely sure how to fix it, so I'm kind of guessing here

@github-actions github-actions bot requested a review from slevenick June 17, 2024 14:24
@modular-magician modular-magician added the awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests label Jun 17, 2024
@r-teller
Copy link
Contributor Author

I believe i have updated all firewall rules that would have failed based on missing descriptions

@modular-magician modular-magician removed the awaiting-approval Pull requests that needs reviewer's approval to run presubmit tests label Jun 17, 2024
@modular-magician
Copy link
Collaborator

Hi there, I'm the Modular magician. I've detected the following information about your changes:

Diff report

Your PR generated some diffs in downstreams - here they are.

google provider: Diff ( 2 files changed, 35 insertions(+), 2 deletions(-))
google-beta provider: Diff ( 2 files changed, 35 insertions(+), 2 deletions(-))
terraform-google-conversion: Diff ( 4 files changed, 5 insertions(+), 1 deletion(-))

@modular-magician
Copy link
Collaborator

Tests analytics

Total tests: 960
Passed tests: 885
Skipped tests: 74
Affected tests: 1

Click here to see the affected service packages
  • compute

Action taken

Found 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected tests
TestAccComputeInstanceNetworkIntefaceWithSecurityPolicy

Get to know how VCR tests work

@modular-magician
Copy link
Collaborator

$\textcolor{red}{\textsf{Tests failed during RECORDING mode:}}$
TestAccComputeInstanceNetworkIntefaceWithSecurityPolicy[Error message] [Debug log]

$\textcolor{red}{\textsf{Please fix these to complete your PR.}}$
View the build log or the debug log for each test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants